package com.ee.bruscar.configuration.parser;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

import com.ee.bruscar.configuration.InterfaceConfiguration;

public class InterfaceConfigXmlParser
{
	public InterfaceConfiguration parse( InputStream stream )
	{
		return (InterfaceConfiguration) XStreamConfig.fromXML(stream);
	}
	
	public InterfaceConfiguration parse( File file )
	{
		try
		{
			FileInputStream stream  = new FileInputStream( file );
			return (InterfaceConfiguration) XStreamConfig.fromXML( stream );
		}
		catch (FileNotFoundException e) 
		{
			throw new RuntimeException( this.getClass().getName() + " : Can't find the file: " + file );
		}
	}
}
